home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
BORL_TIP
/
TI100
/
TI674.ASC
< prev
next >
Wrap
Text File
|
1994-10-03
|
2KB
|
109 lines
PRODUCT : Pascal NUMBER : 674
VERSION : All
OS : DOS
DATE : September 30, 1994 PAGE : 1/2
TITLE : Change Foreground and Background Color
{
This program will place a new foreground and background color and
pattern on the desktop. It will also set the character that is
displayed for the pattern.
This example: the $05 defines the 0 for black foreground and
the 5 for purple background.
}
program ColorManipulation;
uses
Dos, Objects, Drivers, Memory, Views,
Menus, Dialogs, App;
type
PMyBack = ^TMyBack;
TMyBack = object(TBackground)
constructor Init(var Bounds: TRect);
end;
PMyApp = ^TMyApp;
TMyApp = object(TApplication)
MyBack: PMyBack;
constructor Init;
function GetPalette:PPalette; virtual;
end;
function TMyApp.GetPalette: PPalette;
const
MyBackColor : TPalette = CColor; { sets palette to CColor }
{ items }
begin
MyBackColor[1]:=#$05; { TBackGround Color Constant's first }
{ number is background and second is }
{ foreground }
GetPalette := @MyBackColor;
PRODUCT : Pascal NUMBER : 674
VERSION : All
OS : DOS
DATE : September 30, 1994 PAGE : 2/2
TITLE : Change Foreground and Background Color
end;
constructor TMyBack.Init(var Bounds: TRect);
begin
TBackground.Init(Bounds, '▓');{ places ASCII 178 char as }
{ pattern for text on desktop }
end;
constructor TMyApp.Init;
var
R:TRect;
begin
TApplication.Init;
GetExtent(R);
MyBack:= New(PMyBack, init(R));
Desktop^.Background:= MyBack;
Desktop^.Insert(Desktop^.Background);
end;
var
TheApp: TMyApp;
begin
TheApp.Init;
TheApp.Run;
TheApp.Done;
end.
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.